#ifndef GAMEENGINE_H
#define GAMEENGINE_H

#include <allegro5/allegro.h>
#include <allegro5/allegro_image.h>
#include <allegro5/allegro_native_dialog.h>

#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>

#include "BitmapLoader.h"
#include "Sprite.h"
#include "Popeye.h"
#include "Olive.h"
#include "Brutus.h"
#include "StartButton.h"
#include "AnimationFilmHolder.h"
#include "AnimatorHolder.h"
#include "MovingAnimation.h"
#include "MovingAnimator.h"
#include "FrameRangeAnimation.h"
#include "FrameRangeAnimator.h"
#include "FlashingAnimation.h"
#include "FlashingAnimator.h"
#include "LevelTerrain.h"
#include "LevelTerrainHolder.h"
#include "Platform.h"
#include "PlatformHolder.h"
#include "Stair.h"
#include "VerticalStair.h"
#include "DiagonalStair.h"
#include "LeftStair.h"
#include "RightStair.h"
#include "Step.h"
#include "SpinachBox.h"
#include "Spinach.h"
#include "CollisionChecker.h"
#include "common.h"
#include "AI.h"
#include "GameState.h"
#include "Scores.h"
#include "HeartTrophyDisplay.h"
#include "PopeyeFace.h"
#include "AudioHolder.h"

//Starting Pos should probably be part of the level conf, but works for us as is
#define POPEYE_START_X 100
#define POPEYE_START_Y 300 
#define OLIVE_START_X 250
#define OLIVE_START_Y 108 
#define BRUTUS_START_X 100
#define BRUTUS_START_Y 300
#define POPEYE_ANIM 0 //id are not used by us, so don't mind them, put 0 if you want to all
#define OLIVE_ANIM 2

class GameEngine {
private:
	ALLEGRO_DISPLAY *display;
	ALLEGRO_EVENT_QUEUE *event_queue;
	ALLEGRO_TIMER *timer;
	BitmapLoader bitmapLoader;
	AI *ai;
	ALLEGRO_FONT *font24;
public:
	GameEngine();
	~GameEngine();
	void InitiallizeAllegro(void);
	void InitiallizeGraphics(void);
	void LoadLevel(const std::string &id);
	void Input(void);
	void PauseGame(void);
	bool hasWon(void);
	bool hasLost(void);
	void GameLoop(void);
	void GameExit(void);
	void RenderDisplay(void);
};

#endif